-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limiting fitness evaluations #238
Limiting fitness evaluations #238
Conversation
thanks for working on this! didn't have time yet to check it in detail, but as i already mentioned we could think about introducing a general "objective" decorator, that would allow us to do such things like counting the number of objective evaluations in a simpler fashion. this would also remove the need to manually add the @cgp.objective
def objective(individual):
....
return individual what do you think @mschmidt87? |
Totally agree, a general objective wrapper sounds awesome. So, what you're saying is that within this PR, we would use @HenrikMettler 's code and
|
Little activity on this PR, @HenrikMettler are you working on this PR? |
0eeaa62
to
212bdea
Compare
I moved the wrapper into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the changes 👌 i've left some inline comments that should be addressed.
but before getting into that, we need to make sure this works in parallel contexts. would this implementation work there? how are the evaluations counted across different processes?
Should I introduce the objective decorator for all examples and tests within this PR, or in a separate PR? |
let's first figure out a suitable implementation that works with more than one process. we might end up with a different solution than the decorator after all. |
As suggested by @jakobj the counter for objective function calls is now moved to the evolutionary algorithm. Removing it from the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for (re)implementing this so quickly! 🚀
i've added a few inline comments. also please add a unit test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the update! 👌
some more inline comments, then it's ready to merge!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excellent, thanks a lot! 👍
as always, please reorganize the history before merging.
… that either max_gen or max_eval is not inf
…to ensure finite evolve
178afb4
to
1250a58
Compare
This PR draft is a suggestion for a solution to #224
It works by counting the calls of the objective function using a decorator (as suggested eg: https://stackoverflow.com/questions/21716940/is-there-a-way-to-track-the-number-of-times-a-function-is-called). I am not sure if this is a reasonable approach, mainly two things bother me: